package cn.nange.eurekaclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class HelloController {
    /**
     * @Value("${server.port}") 可以获取到application配置文件中的数据
     */
    @Value("${server.port}")
    private String port;
    @RequestMapping("helloController1")
    public String helloController1(String name){
        return "我是client1是一个生成者:+"+port+"+"+name;
    }
    /**
     * @RequestBody 获取请求体中的参数 json
     * @param map
     * @return
     */

    @RequestMapping("testPost")
    public String testPost(@RequestBody Map map){
        System.out.println("map = " + map);
        return "testPost:"+port;
    }

}
